<?php

class HeaderWidget extends CWidget{
    //
    public function run(){
        //
        $root = Menu::model()->findByPk(18);
        $menus = $root->children()->findAll(array('order'=>'orders ASC'));
        //
        $cart = Cart::getInstance();
        $items = $cart->countProduct();
        $this->render('header',array('menus' => $menus,'items' => $items));
    }
}